#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        vector<int> a(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }
        
        // 为了获得最大乘积，应该给最小的数字加1
        int min_idx = 0;
        for (int i = 1; i < n; i++) {
            if (a[i] < a[min_idx]) {
                min_idx = i;
            }
        }
        a[min_idx]++;
        
        long long result = 1;
        for (int i = 0; i < n; i++) {
            result *= a[i];
        }
        
        cout << result << "\n";
    }
    
    return 0;
}